package com.zjj.algorithm.learning.atguigu.algorithm;

/**
 * @author zjj_admin
 * @date 2023/1/3 20:53
 */
public class GraphPath implements Comparable<GraphPath>{
    char start;
    char end;
    int length;

    public GraphPath(char start, char end, int length) {
        this.start = start;
        this.end = end;
        this.length = length;
    }

    @Override
    public String toString() {
        return "{" +
                "start = " + start +
                ", end = " + end +
                ", length = " + length +
                '}';
    }

    /**
     * 重写排序构造方法，按照路劲从小到大的方式排序
     *
     * @param o
     * @return
     */
    @Override
    public int compareTo(GraphPath o) {
        return this.length < o.length ? -1 : 1;
    }

}
